package org.doubango.FrCall.Screens;

import org.doubango.FrCall.Engine;
import org.doubango.FrCall.R;
import org.doubango.FrCall.Services.IScreenService;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ScreenPersonalInfo extends BaseScreen {
	
	private static final String TAG = BaseScreen.class.getCanonicalName();
	private IScreenService mScreenService;
	private Button backToSetViewFromEditView;
	private Button setImage;
	private Button setNickName;
	private Button setSex;
	private Button setAge;
	private Button setRegion;
	
	public ScreenPersonalInfo() {
		super(SCREEN_TYPE.SET_PERSONAL_INFO, TAG);
		mScreenService = ((Engine)Engine.getInstance()).getScreenService();
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.screen_edit_personal_info);
		
		backToSetViewFromEditView = (Button) findViewById(R.id.back_to_set_view_from_edit_view);
		setImage = (Button) findViewById(R.id.set_image);
		setNickName = (Button) findViewById(R.id.set_nickname);
		setSex = (Button) findViewById(R.id.set_sex);
		setAge = (Button) findViewById(R.id.set_age);
		setRegion = (Button) findViewById(R.id.set_region);
		
		ScreenPersonalInfoButtonListener editPersonalInfoListener = new ScreenPersonalInfoButtonListener();
		backToSetViewFromEditView.setOnClickListener(editPersonalInfoListener);
		setImage.setOnClickListener(editPersonalInfoListener);
		setNickName.setOnClickListener(editPersonalInfoListener);
		setSex.setOnClickListener(editPersonalInfoListener);
		setAge.setOnClickListener(editPersonalInfoListener);
		setRegion.setOnClickListener(editPersonalInfoListener);
		
	}
	public class ScreenPersonalInfoButtonListener implements OnClickListener{
		@Override
		public void onClick(View v) {
			if(v == backToSetViewFromEditView){
				mScreenService.show(ScreenTabSet.class);
			}else if(v == setImage){
				mScreenService.show(ScreenSetImage.class);
			}else if(v == setNickName){
				mScreenService.show(ScreenSetNickname.class);
			}else if(v == setSex){
				mScreenService.show(ScreenSetSex.class);
			}else if(v == setAge){
				mScreenService.show(ScreenSetAge.class);
			}else if(v == setRegion){
				mScreenService.show(ScreenSetRegion.class);
			}
		}
		
	}

}
